<template>
  <div class="submit_btn" v-click-move @click="openDialog">
    {{ sure_text }}
  </div>
  <div class="see_d" v-click-move @click="changeInsDialog(true)">
    {{ lang.instrucoes }} >
  </div>
  <InsDialog :show="showInsDialog" @changeInsDialog="changeInsDialog" />
  <DepDialog
    :formData="formData"
    :show="showDepDialog"
    @close="changeDepDialog(false)"
  />
</template>

<script setup lang="ts">
import InsDialog from "./InsDialog.vue";
import DepDialog from "./DepDialog.vue";

const lang: any = getCurrentPageLang("carteira");

const props = defineProps(["activeTab", "formData"]);

// 确定按钮文案
const sure_text = computed(() => {
  return props.activeTab === 1 ? lang.deposit_btn : lang.sacar_btn;
});

// 弹出弹窗
const showInsDialog = ref(false);
const changeInsDialog = (val: boolean) => {
  showInsDialog.value = val;
};

// 弹出弹窗
const showDepDialog = ref(false);
const changeDepDialog = (val: boolean) => {
  showDepDialog.value = val;
};

function openDialog() {
  if (props.activeTab === 1) {
    changeDepDialog(true);
  }
}
</script>

<style scoped lang="scss">
.submit_btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.2rem;
  cursor: pointer;
  font-size: 0.54rem;
  font-weight: 600;
  border-radius: 0.3rem;
  color: var(--theme-neutral1);
  background: linear-gradient(270deg, #e150a4 0%, #e66fc8 81%);
}
.see_d {
  margin-top: 0.29rem;
  display: flex;
  justify-content: center;
  color: #86718c;
}
</style>
